<template>
	<article>
		<el-dialog
		  title="权限设置"
		  :visible.sync="bol"
		  :close-on-click-modal="false"
		  :close-on-press-escape="false"
		  :show-close="false"
		  size="small">
		
			<el-tree
			  	:data="dadtaList"
			  	show-checkbox
			  	node-key="name"
				ref="tree"
				class="tree"
			  	:default-expanded-keys="[2, 3]"
			  	:default-checked-keys="[5]"
			  	:props="defaultProps">
			</el-tree>

		  	<span slot="footer" class="dialog-footer">
		    	<el-button @click="cancel">取 消</el-button>
		    	<el-button type="primary" @click="submit">确 定</el-button>
		  	</span>
		</el-dialog>
	</article>
</template>

<script type="text/javascript">
	export default {
		data () {
			return {
				bol: true,
				dadtaList: [
					{
			          	name: 'yf',
			          	label: '研发',
			          	children: [
			          		{
			            		name: 'yfjkgl',
			            		label: '接口管理',
			            		children:[
			            		   { name:'params', label:'参数' },
			            		   { name:'code', label:'代码' },
			            		   { name:'test', label:'测试' },
			            		   { name:'edit', label:'编辑' },
			            		   { name:'info', label:'详情' },
			            		   { name:'del', label:'删除' },
			            		   { name:'add', label:'添加' }
			            		]
			          		},
			          		{
			            		name: 'yfjkjk',
			            		label: '接口监控'
			          		},
			          		{
			            		name: 'yfsjkbgl',
			            		label: '数据库表管理'
			          		}
			        	]
			        },
			        {
						name: 'xz',
						label: '行政',
						
						children: [{
								name: 'xzrygl',
								label: '人员管理',
								children:[
			            		   { name:'edit', label:'修改' },
			            		   { name:'ckbj', label:'查看班级' },
			            		   { name:'isqy', label:'启用' },
			            		   { name:'power', label:'权限' },
			            		   { name:'reset', label:'密码重置' },
			            		   { name:'del', label:'删除' },
			            		   { name:'add', label:'添加' }
			            		]
							},
							{
								name: 'xzjsgl',
								label: '教室管理'
							},
							{
								name: 'xzpjgl',
								label: '评价管理'
							},
							{
								name: 'xzqjgl',
								label: '请假管理'
							},
							{
								name: 'xzjjrgl',
								label: '节假日管理'
							},
							{
								name: 'xzlsjs',
								label: '老师（结算）'
							}
						]
					},

			        {
			          	name: 'jw',
			          	label: '教务',
			          	children: [
			          		{
			            		name: 'jwbjgl',
			            		label: '班级管理'
			          		},
			          		{
			            		name: 'jwlsgl',
			            		label: '老师管理'
			          		},
			          		{
			            		name: 'jwghgl',
			            		label: '工号管理'
			          		},
			          		{
			            		name: 'jwpklb',
			            		label: '排课列表'
			          		},
			          		{
			            		name: 'jwjjrgl',
			            		label: '节假日管理'
			          		},
			          		{
			            		name: 'jwlskb',
			            		label: '老师课表'
			          		},
			          		{
			            		name: 'jwkq',
			            		label: '考勤'
			          		}
			        	]
			        },
			        {
			          	name: 'bmjf',
			          	label: '报名缴费',
			          	children: [
			          		{
			            		name: 'bmjfjfgl',
			            		label: '缴费管理'
			          		},
			          		{
			            		name: 'bmjfcjgl',
			            		label: '催缴管理'
			          		},
			          		{
			            		name: 'bmjftfgl',
			            		label: '退费管理'
			          		},
			          		{
			            		name: 'bmjftfsh',
			            		label: '退费审核'
			          		},
			          		{
			            		name: 'bmjftftj',
			            		label: '退费统计'
			          		},
			          		{
			            		name: 'bmjftj',
			            		label: '统计'
			          		}
			        	]
			        },
			        {
			          	name: 'jxcgl',
			          	label: '进销存管理',
			          	children: [
			          		{
			            		name: 'jxcglcksz',
			            		label: '仓库设置'
			          		},
			          		{
			            		name: 'jxcglwpsz',
			            		label: '物品设置'
			          		},
			          		{
			            		name: 'jxcglkssz',
			            		label: '课时设置'
			          		},
			          		{
			            		name: 'jxcglkccx',
			            		label: '库存查询'
			          		},
			          		{
			            		name: 'jxcglcgrk',
			            		label: '采购入库'
			          		},
			          		{
			            		name: 'jxcglcgth',
			            		label: '采购退货'
			          		},
			          		{
			            		name: 'jxcglbs',
			            		label: '报损'
			          		},
			          		{
			            		name: 'jxcgllsly',
			            		label: '老师领用'
			          		},
			          		{
			            		name: 'jxcgllstl',
			            		label: '老师退领'
			          		},
			          		{
			            		name: 'jxcglxsxs',
			            		label: '学生销售'
			          		}
			        	]
			        },
                    {
			          	name: 'tjbb',
			          	label: '统计报表',
			          	children: [
			          		{
                                name: 'tjbblssk',
                                label: '老师的上课统计'
                            },
                            {
                                name: 'tjbbxssk',
                                label: '学生的上课统计'
                            },
                            {
                                name: 'tjbbcw',
                                label: '财务报表'
                            },
                            {
                                name: 'tjbbxsls',
                                label: '学生流失警报'
                            },
                            {
                                name: 'tjbblsks',
                                label: '老师课时统计'
                            }
			        	]
			        }

		        ],
		        defaultProps: {
		          children: 'children',
		          label: 'label'
		        }
			}
		},
		methods: {
			cancel () {
                this.$emit('close',{type:'authority',cancel:true})
			},
			submit () {
                this.$emit('close',{type:'authority',cancel:true})
			}
		}
	}
</script>